import { createStore } from 'vuex'

export default createStore({
  state: {
    is_dark: false,
    questions: [
      {
        "questionId": "30939261448a3ef48a20a41a88013887",
        "courseId": "a9ac66d328b619ae3ad5145dc0d4246a",
        "questionStem": "{{ questionStem }}",
        "questionType": "radio",
        "questionTypeName": "单选题",
        "courseLineId": "dd24a028e5c237d8257b9e56d7acae06",
        "courseLineNumber": "第一章",
        "answer": "D",
        "options": [
            {
                "content": "{{ choice }}",
                "option": "A"
            },
            {
                "content": "{{ choice }}",
                "option": "B"
            },
            {
                "content": "{{ choice }}",
                "option": "C"
            },
            {
                "content": "{{ choice }}",
                "option": "D"
            }
        ]
    }
    ],
    index: 0,
    curr_status: 'recite',
    user_answer: [],
    ques_status: [null, null, null, null],
  },
  mutations: {
    set_dark_mode(state, payload) {
      state.is_dark = payload
    },
    set_questions(state, payload) {
      state.questions = payload
    },
    set_index(state, payload) {
      state.index = payload
    },
    set_curr_status(state, payload) {
      state.curr_status = payload
    },
    set_ques_status(state, payload) {
      state.ques_status = payload
    }
  },
  actions: {
  },
  modules: {
  }
})
